#ifndef BITMAPFILE_H__9EF85D12_5CE6_449D_B95A_16139DB90491
#define BITMAPFILE_H__9EF85D12_5CE6_449D_B95A_16139DB90491

#include "stdafx.h"

class BitmapFile
{
public:
	explicit BitmapFile(std::string &filename);
	~BitmapFile();

	static void ShowPicture(std::string &filename);

	void SetBitmapFileHeader(BITMAPFILEHEADER *pFileHeader);
	void SetBitmapInfoHeader(BITMAPINFOHEADER *pInfoHeader);
	void SetBitmapColorTable(RGBQUAD *pColorTable, const unsigned int size = 256);
	BITMAPFILEHEADER GetBitmapFileHeader() const;
	BITMAPINFOHEADER GetBitmapInfoHeader() const;
	std::vector<RGBQUAD> GetBitmapColorTable() const;
	std::string GetCurrentBmpFileName() const;

	void Rotate90Clockwise();
	void FlipHorizontal();
	void FlipVertical();
	void Grey();

	void SaveChangeToFile(std::string &filename);

private:
	BitmapFile(const BitmapFile &);
	BitmapFile& operator=(const BitmapFile &);

	void Read24BmpPixels(std::vector<std::vector<RGBTRIPLE> > &pixels);

	BITMAPFILEHEADER m_fileheader;
	BITMAPINFOHEADER m_infoheader;
	std::string m_filename;
	std::vector<RGBQUAD> m_colortable;
	std::vector<BYTE> m_picturedata;
	std::vector<std::vector<RGBTRIPLE> > m_pixels;
	
	static unsigned int m_numbers;
};
#endif // BitmapFile_h__
